# -*- ecoding: utf-8 -*-
# @Author: Wick
# @Time: 2024-02-24 0:35

list1 = [1, 2, 2, 3, 3, 5, 7]
list2 = [2, 3, 3, 4]


i = j = 0

while i<len(list1) and j<len(list2):
    if list1[i] == list2[j]:
        print(f"{list2[j]}")
        i += 1
        j += 1
    else:
        if list1[i] > list2[j]:
            j += 1
        else:
            i += 1



